package com.cskt.petoms.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * 自定义restTemplate配置
 *
 * @author admin
 **/
@Configuration
//value:用于针对哪一个服务，configuraion:指定自定义的负载均衡策略配置
@LoadBalancerClient(name = "pet-ums", configuration = CustomLoadBalancerConfig.class)
public class CustomRestTemplateConfig {
    
    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
